package com.caozf.singleton.hungry;

/**
 * 创建时间：2019/9/12 20:26
 * 创建人:曹子方
 */
public class HungrySingleton {
    private  static HungrySingleton hungrySingleton=new HungrySingleton();
    private HungrySingleton(){
        if(hungrySingleton!=null){
            throw new  RuntimeException("不允许创建多个实例，请访问getInstance方法获得实例");
        }
    }

    public static HungrySingleton getInstance(){
        return hungrySingleton;
    }
}
